﻿using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category0
{
  public class MTS02 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagDefinition U0004;
    private static SwiftTagSubItemDefinition U0005;
    private static SwiftTagDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;

    [Description("User Authentication")]
    public Tag501 UserAuthentication_501
    {
      get
      {
        return new Tag501((SwiftElement) this, 0, (SwiftDefinitionElement) MTS02.U0002);
      }
    }

    [Description("User Authentication")]
    public Tag501 Tag501_UserAuthentication
    {
      get
      {
        return this.UserAuthentication_501;
      }
    }

    [Description("Window Size")]
    public MTS02.Tag110 WindowSize_110
    {
      get
      {
        return new MTS02.Tag110((SwiftElement) this, 0, (SwiftDefinitionElement) MTS02.U0004);
      }
    }

    [Description("Window Size")]
    public MTS02.Tag110 Tag110_WindowSize
    {
      get
      {
        return this.WindowSize_110;
      }
    }

    [Description("Reconnect Allowed")]
    public Tag329 ReconnectAllowed_329
    {
      get
      {
        return new Tag329((SwiftElement) this, 0, (SwiftDefinitionElement) MTS02.U0006);
      }
    }

    [Description("Reconnect Allowed")]
    public Tag329 Tag329_ReconnectAllowed
    {
      get
      {
        return this.ReconnectAllowed_329;
      }
    }

    [Description("Current Session Information")]
    public Tag330 CurrentSessionInformation_330
    {
      get
      {
        return new Tag330((SwiftElement) this, 0, (SwiftDefinitionElement) MTS02.U0008);
      }
    }

    [Description("Current Session Information")]
    public Tag330 Tag330_CurrentSessionInformation
    {
      get
      {
        return this.CurrentSessionInformation_330;
      }
    }

    public MTS02()
      : base(true)
    {
    }

    public MTS02(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MTS02.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MTS02.MessageDefinition = new SwiftMessageDefinition("MTS02", "Login Request Message");
      MTS02.U0002 = new SwiftTagDefinition("UserAuthentication_501", "User Authentication");
      MTS02.U0002.TagName = "{501:";
      MTS02.U0003 = new SwiftTagSubItemDefinition("UserAuthentication", "User Authentication");
      MTS02.U0002.Elements.Add((SwiftDefinitionElement) MTS02.U0003);
      MTS02.MessageDefinition.Elements.Add((SwiftDefinitionElement) MTS02.U0002);
      MTS02.U0004 = new SwiftTagDefinition("WindowSize_110", "Window Size");
      MTS02.U0004.TagName = "{110:";
      MTS02.U0005 = new SwiftTagSubItemDefinition("WindowSize", "Window Size");
      MTS02.U0004.Elements.Add((SwiftDefinitionElement) MTS02.U0005);
      MTS02.MessageDefinition.Elements.Add((SwiftDefinitionElement) MTS02.U0004);
      MTS02.U0006 = new SwiftTagDefinition("ReconnectAllowed_329", "Reconnect Allowed");
      MTS02.U0006.TagName = "{329:";
      MTS02.U0006.Mandatory = false;
      MTS02.U0007 = new SwiftTagSubItemDefinition("ReconnectAllowed", "Reconnect Allowed");
      MTS02.U0006.Elements.Add((SwiftDefinitionElement) MTS02.U0007);
      MTS02.MessageDefinition.Elements.Add((SwiftDefinitionElement) MTS02.U0006);
      MTS02.U0008 = new SwiftTagDefinition("CurrentSessionInformation_330", "Current Session Information");
      MTS02.U0008.TagName = "{330:";
      MTS02.U0008.Mandatory = false;
      MTS02.U000E = new SwiftTagSubItemDefinition("SessionNumber", "Session Number");
      MTS02.U0008.Elements.Add((SwiftDefinitionElement) MTS02.U000E);
      MTS02.U000F = new SwiftTagSubItemDefinition("ISN", "Input Sequence Number");
      MTS02.U0008.Elements.Add((SwiftDefinitionElement) MTS02.U000F);
      MTS02.U0010 = new SwiftTagSubItemDefinition("ISNNAK", "Session information - Identifies last Input NAK of previous session.");
      MTS02.U0008.Elements.Add((SwiftDefinitionElement) MTS02.U0010);
      MTS02.U0011 = new SwiftTagSubItemDefinition("OSN", "Output Sequence Number");
      MTS02.U0008.Elements.Add((SwiftDefinitionElement) MTS02.U0011);
      MTS02.U0012 = new SwiftTagSubItemDefinition("OSNNAK", "Session information - Identifies last Output NAK of previous session.");
      MTS02.U0008.Elements.Add((SwiftDefinitionElement) MTS02.U0012);
      MTS02.U0013 = new SwiftTagSubItemDefinition("ACKReplayIndicator", "Session information - Indicates the last ACK can be replayed.");
      MTS02.U0008.Elements.Add((SwiftDefinitionElement) MTS02.U0013);
      MTS02.MessageDefinition.Elements.Add((SwiftDefinitionElement) MTS02.U0008);
    }

    public class Tag110 : SwiftTagWrapper
    {
      public string Value
      {
        get
        {
          return this.GetValue();
        }
        set
        {
          this.SetValue("110", value);
        }
      }

      internal Tag110(SwiftElement parent, int index, SwiftDefinitionElement definition)
        : base(parent, index, definition)
      {
      }
    }
  }
}
